import requestProxy from '@/utils/request';
const { request } = requestProxy;

// 获取设置列表
export function getSubcribeList(params) {
  return request({
    url: '/admin/subscrbe/list',
    method: 'get',
    params
  });
}

// 获取预约日期列表
export function getSubcribeCalendars(params, cancelToken) {
  return request({
    url: 'admin/subscrbe/calendar',
    method: 'get',
    params,
    cancelToken
  });
}

// 新建预约
export function createSubcribe(data) {
  return request({
    url: 'admin/subscrbe/create',
    method: 'post',
    data
  });
}

// 编辑预约
export function editSubcribe(data, id) {
  return request({
    url: `admin/subscrbe/edit/${id}`,
    method: 'put',
    data
  });
}

// 预约详情
export function subcribeDetail(id) {
  return request({
    url: `admin/subscrbe/detail/${id}`,
    method: 'get'
  });
}

// 删除预约
export function subscribeDelete(id, params) {
  return request({
    url: `admin/subscrbe/delete/${id}`,
    method: 'delete',
    params
  });
}

// 预约状态
export function changeSubcribeStatus(data) {
  return request({
    url: 'admin/subscrbe/changeStatus',
    method: 'put',
    data
  });
}

// 获取预约统计
export function getSubcribeStatistics(params, cancelToken) {
  return request({
    url: 'admin/subscrbe/statistics',
    method: 'get',
    params,
    cancelToken
  });
}
